<!--
 * @Author: lihaogn
 * @Date: 2021-12-15 09:48:06
 * @LastEditTime: 2022-01-19 17:58:49
 * @LastEditor: lihaogn
 * @Description: 模板页面
 * @FilePath: \lix-admin-vue2\src\views\develop\index.vue
-->
<template>
  <div class="gl-view-rootbox">
    <el-button @click="visit(0)">表格模板</el-button>
    <el-button @click="visit(1)">基础对话框</el-button>
    <el-button @click="visit(2)">基础抽屉</el-button>

    <UploadDemo />

    <DialogBasicTemplate
      :visible.sync="dialogVisible"
      title="对话框"
      @ok="handleDialogOk"
    />

    <DrawerBasicTemplate
      :visible.sync="drawerVisible"
      title="抽屉"
      @ok="handleDrawerOk"
    />
  </div>
</template>

<script>
import DialogBasicTemplate from './template/DialogBasicTemplate.vue'
import DrawerBasicTemplate from './template/DrawerBasicTemplate.vue'
import UploadDemo from './demo/UploadDemo.vue'

export default {
  components: { DialogBasicTemplate, DrawerBasicTemplate, UploadDemo },
  data() {
    return {
      dialogVisible: false,
      drawerVisible: false
    }
  },
  methods: {
    visit(type) {
      switch (type) {
        case 0:
          this.$router.push({ name: 'tableViewTemplateDemo' })
          break
        case 1:
          this.dialogVisible = true
          break
        case 2:
          this.drawerVisible = true
          break
        default:
          break
      }
    },
    handleDialogOk() {
      this.$message.success('对话框点击了确定按钮')
    },
    handleDrawerOk() {
      this.$message.success('抽屉确定返回')
    }
  }
}
</script>

<style lang="less" scoped></style>
